import request from '../utils/request';


// 登录
export const apiLogin = (data) => {
    return request({
        url: '/api/login',
        method: 'post',
        data
    })
}

// 获取用户信息
export const apigetUserInfo = () => {
    return request({
        url: '/api/getUserInfo',
    })
}

// 获取居民信息列表
// 分页器， 搜索，
export const apigetList = (data) => {
    return request({
        url: '/api/getList',
        method: 'post',
        data
    })
}

// 删除
export const apiDeleteItem = (data) => {
    return request({
        url: `/api/deletaItem/${data.id}`,
        method: 'DELETE'
    })
}

// 添加 / 修改
export const apiAddItem = (data) => {
    return request({
        url: '/api/addItemOrEditItem',
        method: 'post',
        data
    })
}

// 详情
export const apigetDetail = (data) => {
    return request({
        url: '/api/getDetail',
        method: 'post',
        data
    })
}